home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / utils / shortbin.lzh / SORT.DOC < prev    next >
Text File  |  1989-11-30  |  3KB  |  91 lines

  1.  
  2.  
  3.  
  4.  
  5.                                                           sort(1)
  6.  
  7.  
  8.  
  9. NAME
  10.      sort - sort and/or merge files
  11.  
  12. SYNTAX
  13.      sort [ -bdfimnrutx ] [ +pos1  [ -pos2 ] ] [ -o name ] [ -T dir ] [ name...]
  14.  
  15. DESCRIPTION
  16.      Sort sorts, then writes the lines of the named files to its standard
  17.      output, or a file (-o option).
  18.      Default (no input files are named), the standard input is sorted.
  19.      The name "-" stands for the standard input, so that standard input can be
  20.      used together with other input files.
  21.  
  22.      By default, the sort key is an entire line; ordering is lexicographic.
  23.      The global ordering is affected by zero or more of the following options
  24.      (of which some combinations are meaningless, e.g. d and n).
  25.  
  26.      -b   Leading blanks (spaces and tabs) are skipped in field comparisons.
  27.  
  28.      -d   Dictionary order: only letters, digits and blanks are
  29.           significant in comparisons.
  30.  
  31.      -f   Fold: treat upper case as if lower case.
  32.  
  33.      -i   Ignore characters outside the ASCII range 040-0176 in
  34.           nonnumeric comparisons.
  35.  
  36.      -n   An initial numeric string, consisting of optional
  37.           blanks, optional minus sign, and zero or more digits
  38.           with optional decimal point, is sorted by arithmetic
  39.           value. This option implies option b.
  40.  
  41.      -r   Reverse the result of comparisons.
  42.  
  43.      -tx  `Tab character' field separator is x.
  44.  
  45.      The notation +pos1 -pos2 restricts a sort key to a field
  46.      beginning at pos1 and ending just before pos2.
  47.      Pos1 and pos2 each have the form m.n, optionally followed by one
  48.      or more of the options bdfinr, where m tells a number of fields
  49.      to skip from the beginning of the line and n tells a number
  50.      of characters to skip further.  If any options are present
  51.      they override all the global ordering options for this key.
  52.      If the b option is in effect n is counted from the first
  53.      nonblank in the field.
  54.      A missing .n means .0; a missing -pos2 means the end of the
  55.      line.  Under the -tx option, fields are strings separated by
  56.      x; otherwise fields are nonempty nonblank strings separated
  57.      by blanks.
  58.  
  59.      When there are multiple sort keys, later keys are compared
  60.      only after all earlier keys compare equal.
  61.  
  62.      These are additional (global) options:
  63.  
  64.      -c   Check that the input file is sorted according to the key(s);
  65.           if the file is out of sort, an error message is printed.
  66.           Exit code is 0/1 for correctly/incorrectly sorted input.
  67.  
  68.      -m   Merge only, the input files are already sorted.
  69.  
  70.      -o   The next argument is the output file used instead of the
  71.           standard output. This file may be the same as one of the inputs.
  72.  
  73.      -T   Temporary files directory. Default is \tmp on the current drive.
  74.  
  75.      -u   Unique: Select only one in each set of, according to the
  76.           key(s), equal lines.
  77.  
  78. RESTRICTIONS
  79.      Very long (>256 chars) lines are silently truncated.
  80.      The line terminator sequence \r\n is present in the line when
  81.      doing comparisions; this should not present problems. Use of \0 in
  82.      input is discouraged, since this will be seen as a C string terminator.
  83.  
  84. DIAGNOSTICS
  85.      Comments and exits with nonzero status for various trouble
  86.      conditions and for disorder discovered under option c(heck).
  87.  
  88. FILES
  89.      \tmp\*  for temporary files.
  90.  
  91.